package com.xius.service.impl;
import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xius.dao.SecUserDao;
import com.xius.service.SecUserService;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/*
* * (SecUser)表服务接口 *
* @author makejava
* @since 2020-07-20 16:52:41
*/
@Service("secUserService")public class SecUserServiceImpl implements SecUserService {
    @Autowired    private SecUserDao secUserDao;
    @Override    public List<Map<String,Object>> queryAllByLimit(Map<String,Object> map) {
        return secUserDao.queryAllByLimit(map);
    }
    @Override    public int insert(Map<String,Object> map){
        String now = DateUtil.now();
        map.put("secUserCreateTime",now);
        map.put("secUserUpdateTime",now);
        return secUserDao.insert(map);
    }
    @Override    public int inserts(List<Map<String,Object>> list){
        String now = DateUtil.now();
        for (Map<String, Object> map : list) {
            map.put("secUserCreateTime",now);
            map.put("secUserUpdateTime",now);
        }
        return secUserDao.inserts(list);
    }
    @Override    public Map<String,Object> queryById(Map<String,Object> map){
        return secUserDao.queryById(map);
    }
    @Override    public int update(Map<String,Object> map) {
        String now = DateUtil.now();
        map.put("secUserUpdateTime",now);
        return secUserDao.update(map);
    }
    @Override    public int deleteById(Map<String,Object> map) {
        return secUserDao.deleteById(map);
    }
    @Override    public int deleteByIds(Map<String,Object> map) {
        return secUserDao.deleteByIds(map);
    }
    @Override    public PageInfo<List<Map<String,Object>>> queryAllJoin(Map<String,Object> map){
        int pageNum = (int) map.get("pageNum");
        int pageSize = (int) map.get("pageSize");
        PageHelper.startPage(pageNum,pageSize);
        List<Map<String,Object>> list = secUserDao.queryAllJoin(map);
        PageInfo<List<Map<String,Object>>> pageInfo=new PageInfo(list);
        return pageInfo;
    }
    @Override    public PageInfo<List<Map<String,Object>>> queryAll(Map<String,Object> map){
        int pageNum = (int) map.get("pageNum");
        int pageSize = (int) map.get("pageSize");
        PageHelper.startPage(pageNum,pageSize);
        List<Map<String,Object>> list = secUserDao.queryAll(map);
        PageInfo<List<Map<String,Object>>> pageInfo=new PageInfo(list);
        return pageInfo;
    }
}
